﻿namespace Renci.Data.Interop.OpenGIS.Gml
{
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.opengis.net/gml")]
    [System.Xml.Serialization.XmlRootAttribute("TimePeriod", Namespace = "http://www.opengis.net/gml", IsNullable = false)]
    public class TimePeriodType : AbstractTimeGeometricPrimitiveType
    {
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("begin", Type = typeof(TimeInstantPropertyType))]
        [System.Xml.Serialization.XmlElementAttribute("beginPosition", Type = typeof(TimePositionType))]
        public object BeginTime { get; set; }

        /// <summary>
        /// Helper method to get typed BeginTime
        /// </summary>
        /// <typeparam name="T">Valid types as TimeInstantPropertyType and TimePositionType</typeparam>
        /// <returns></returns>
        public T GetBeginTime<T>()
            where T : class
        {
            return this.BeginTime as T;
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("end", Type = typeof(TimeInstantPropertyType))]
        [System.Xml.Serialization.XmlElementAttribute("endPosition", Type = typeof(TimePositionType))]
        public object EndTime { get; set; }

        /// <summary>
        /// Helper method to get typed EndTime
        /// </summary>
        /// <typeparam name="T">Valid types as TimeInstantPropertyType and TimePositionType</typeparam>
        /// <returns></returns>
        public T GetEndTime<T>()
            where T : class
        {
            return this.EndTime as T;
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("duration", DataType = "duration")]
        public string Duration
        {
            get;
            set;
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("timeInterval")]
        public TimeIntervalLengthType TimeInterval
        {
            get;
            set;
        }
    }
}
